<template>
  <div>
    书名：<input type="text" v-model="title" /> 价格：<input
      type="text"
      v-model="price"
    />
    <button @click="add">添加</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      title: "",
      price: "",
    };
  },
  mounted() {},
  methods: {
    add() {
      this.$emit("add", this.title, this.price);
    },
  },
  components: {},
};
</script>

<style lang="scss"></style>
